<%@ page language="java" import="java.util.*,model.bo.Sub" pageEncoding="utf-8"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles" %>
<%
String path = request.getContextPath();
%>
<div class="header">
	<div class="logo">
		<div class="title">
			<img src="images/logo.jpg">
		</div>
		<div class="login">
			<ul>
				<li style="background: none;">
					<img src="images/ico-03.gif" width="10" height="10"><a title="加为收藏" href="javascript:void(0)">加为收藏</a>
				</li>
				<li>
					<img src="images/ico-02.gif" width="10" height="10"><a title="注册" href="./web.do?method=reg">注册</a>
				</li>
			</ul>
		</div>
	</div>
</div>
<!-- 导航开始 -->
<div class="menu">
	<logic:notEmpty name="topMenu">
		<logic:empty name="typename">
			<ul>
				<li style="margin-left:10px;">
					<a href="./web.do?method=index" class="select">网站首页</a>
				</li>
				<logic:iterate id="topMenu" name="topMenu">
					<li>
						<a href="<%=path %>/web.do?method=show&istop=true&typeid=<bean:write name="topMenu" property="id" />"><bean:write name="topMenu" property="subname" /></a>
					</li>
				</logic:iterate>
			</ul>
		</logic:empty>
		<logic:notEmpty name="typename">
			<ul>
				<li style="margin-left:10px;">
					<a href="./web.do?method=index">网站首页</a>
				</li>
				<%
					List<Sub> subList = (List)request.getAttribute("topMenu");
					String subName = (String)request.getAttribute("typename");
					Integer fatherType = (Integer)request.getAttribute("fatherType");
					for(int i=0;i<subList.size();i++){
						//如果选中的是当前的
						if(subList.get(i).getId().equals(fatherType)){
							out.print("<li><a class='select' href='web.do?method=show&istop=true&typeid="+subList.get(i).getId()+"'>"+subList.get(i).getSubname()+"</a></li>");
						}else{
							out.print("<li><a href='web.do?method=show&istop=true&typeid="+subList.get(i).getId()+"'>"+subList.get(i).getSubname()+"</a></li>");
						}
					}
				%>
			</ul>
		</logic:notEmpty>
	</logic:notEmpty>
</div>
<!-- 导航结束 -->